for diagnosis.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
def _marshaled_dispatch(self, data, dispatch_method = None):
params, method = xmlrpclib.loads(data)
+ if False:
+ # Enable this block of code to exit immediately without sending
+ # a response. This allows you to test client-side crash handling.
+ import sys
+ sys.exit(1)
try:
if dispatch_method is not None:
response = dispatch_method(method, params)
import signal
if vncpid:
os.kill(vncpid, signal.SIGKILL)
- raise ex
+ raise
dom = sxp.child_value(dominfo, 'name')
else:
print >>sys.stderr, "Error: %s" % ex.faultString
sys.exit(1)
+ except xmlrpclib.ProtocolError, ex:
+ if ex.errcode == -1:
+ print >>sys.stderr, (
+ "Xend has probably crashed! Invalid or missing HTTP "
+ "status code.")
+ else:
+ print >>sys.stderr, (
+ "Xend has probably crashed! ProtocolError(%d, %s)." %
+ (ex.errcode, ex.errmsg))
+ sys.exit(1)
except (ValueError, OverflowError):
err("Invalid argument.")
usage(argv[1])